#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void *swap(int * pt1, int * pt2)
{
    int temp;
    temp = *pt1;
    *pt1 = *pt2;
    *pt2 = temp;
}

int pointer_test1()
{
    int i = 1;
    int *pi = &i;
    *pi = *pi + 10;
    int j = 2;
    pi = &j;
    int *pi1 = pi;
    char b = 'a';
    char *pb = &b;
    int c = 10, d = 20;
    printf("old c=%d,d=%d\n", c, d);
    swap(&c, &d);
    printf("now c=%d,d=%d\n", c, d);

}

int array_test1()
{
    int a[3];
    int i;
    printf("please input 3 int numbers:");
    for(i = 0; i < 3; i++)
        scanf("%d", &a[i]);
    for(i = 0; i < 3; i++)
        printf("num:%d\n", a[i]);
        //printf("num:%d\n", *(a+i)); //the same as a[i]
    return 0;
}

int main(int argc, char ** argv)
{
    pointer_test1();
	array_test1();
    return 0;
}
